package util;

import java.io.*;

public class IOUtil {

    public static void writeFile(String path,String[] array) throws IOException {
        BufferedWriter out=new BufferedWriter(new FileWriter(path));
        for (String s : array) {
            out.write(s);
            out.write("\n");
        }
        out.close();
    }

    public static String[] readPk(String path) throws IOException {
        BufferedReader in=new BufferedReader(new FileReader("pk.txt"));
        String[] read=new String[5];
        for (int i = 0; i < read.length; i++) {
            read[i]=in.readLine();
        }
        in.close();
        return read;
    }

    public static String[] readMK(String path) throws IOException {
        BufferedReader in=new BufferedReader(new FileReader(path));
        String[] read=new String[2];
        for (int i = 0; i < read.length; i++) {
            read[i]=in.readLine();
        }
        in.close();
        return read;
    }

    public static String[] readAttKey(String path) throws IOException {
        BufferedReader in=new BufferedReader(new FileReader(path));
        String[] read=new String[4];
        for (int i = 0; i < read.length; i++) {
            read[i]=in.readLine();
        }
        in.close();
        return read;
    }

    public static String[] readCT(String path) throws IOException {
        BufferedReader in=new BufferedReader(new FileReader(path));
        String[] read=new String[5];
        for (int i = 0; i < read.length; i++) {
            read[i]=in.readLine();
        }
        in.close();
        return read;
    }

}
